<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>我的空间</title>
    <jsp:include page="./include/commonfiles.jsp"/>
    <link rel="stylesheet" href="${path}/css/index.css">
</head>
<body>
<jsp:include page="include/silderbar.jsp"/>
<div class="layui-body">
    <div class="container">
        <div class="row clearfix">
            <div class="col-md-10 column" style="left: 0px;">
                <div class="btn-group btn-group-sm">
                    <button class="btn btn-default" data-toggle="modal" data-target="#myModal" type="button"><em class="glyphicon glyphicon-align-left"></em>上传图片</button>
                    <button class="btn btn-default"data-toggle="modal" data-target="#myLog" type="button"><em class="glyphicon glyphicon-align-center"></em>发表日志</button>
                </div>
            </div>
        </div>
    </div>


    <%--    显示资源--%>
    <div class="row clearfix">
        <%-- //图片 --%>
        <div class="col-md-6 column" id="showfiles">
            <div class="box">
                <ul id="first-list">
                    <c:forEach items="${sourceslist}" var="lis">
                        <c:if test="${lis.filetype!='日志'}">
                            <li>
                                <span></span>
                                <div class="title">${lis.username}</div>
                                <div class="info"><img src="${lis.urlpath}" style="height: 180px;width: 180px;"></div>
                                <div class="name">- ${lis.filetype} -</div>
                                <div class="time">
                                    <span>${lis.uploadtime}<sup></sup></span>
                                    <span>end</span>
                                </div>
                            </li>
                        </c:if>
                    </c:forEach>

                </ul>

                <script src="JavaScript/timeline-V2.js"></script>
            </div>
            <script src="${path}/js/index.js"></script>
        </div>
        <%--        //日志--%>
        <div class="col-md-6 column" id="showlog">
            <div class="box">
                <ul id="second-list">
                    <c:forEach items="${sourceslist}" var="lis">
                        <c:if test="${lis.filetype=='日志'}">
                            <li>
                                <span></span>
                                <div class="title">${lis.username}</div>
                                <div class="info"><p class="show-logs">${lis.urlpath}</p></div>
                                <div class="name">- ${lis.filetype} -</div>
                                <div class="time">
                                    <span>${lis.uploadtime}<sup></sup></span>
                                    <span>end</span>
                                </div>
                            </li>
                        </c:if>
                    </c:forEach>

                </ul>

                <script src="JavaScript/timeline-V2.js"></script>
            </div>
            <script src="${path}/js/index.js"></script>
        </div>
    </div>

</div>
<%--模态框--%>
<%--模态框 用于上传资源--%>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    上传图片
                </h4>
            </div>
            <form action="${path}/testupload" method="post" enctype="multipart/form-data">
                <div class="modal-body">
                    <input type="file" name="pictureFile" /><br>
                    <input type="hidden" name="use" value="${userInfo.username}">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="submit" class="btn btn-primary">
                        上传
                    </button>
                </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<%--模态框 用于上传日志--%>
<div class="modal fade" id="myLog" tabindex="-1" role="dialog" aria-labelledby="myLogLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myLogLabel">
                    发表日志
                </h4>
            </div>
            <form action="${path}/uploadLog" method="post">
                <div class="modal-body">
                    <input type="text" name="Log" style="width: 100%; padding: 15px 20px 15px 20px" rows="10"></input>
                    <p id="maxLogs">最多输入299个字</p>
                    <input type="hidden" name="use1" value="${userInfo.username}">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="submit" class="btn btn-primary">
                        上传
                    </button>
                </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<script src="${path}/js/jquery-3.6.0.js"></script>
<script>
</script>
</body>
</html>
